package com.activiti6.demo.stress;

import org.activiti.engine.RuntimeService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import java.time.LocalTime;

@Service
//@Scope("prototype")
public class PrintService implements JavaDelegate {

    private static int num = 0;

    public void execute(DelegateExecution execution) {
        System.out.println(LocalTime.now() + " start.-----打印任务正在执行-----" + ++num + "-----" + LocalTime.now() + " end.");
    }

    public void print() {
        System.out.println(LocalTime.now() + " start.-----打印任务正在执行-----" + ++num + "-----" + LocalTime.now() + " end.");
    }

}
